package oop4;

import java.util.Scanner;

/**
 * @author oldliu
 * @since 1.0
 */
public class PetMarket {
    private String name;
    //Pet []ar=
    public PetMarket(String n){
        name=n;
    }
    public Pet sell(int money){
        if(money>=500000){
            return new Tiger("小美丽",99,40,"公");
        }
        if(money>=100000){
            return new Penguin("小蓝企鹅",100,100,"公");
        }
        if(money>=500){
            return new Dog("小花花",59,100,"公","博美");
        }
        return null;
    }

    public static void main(String[] args) {
        PetMarket pm=new PetMarket("裕丰花鸟鱼虫市场");
        Scanner in=new Scanner(System.in);
        System.out.print("打算花多少钱买：");
        Pet pet = pm.sell(in.nextInt());
        if(pet==null){
            System.out.println("钱不够！！！");
            return;
        }
        pet.print();
        //instanceof
    }
}
